<!--<?php
include_once PrintEot('left');
print <<<EOT
-->
<h3><b>提示信息</b></h3>
<div class="tr5">
1、热榜排行可结合PW缓存库进行使用<br />2、如果开启了热榜排行之后，首页的浏览速度减慢，请开启PW缓存库里面相对应的缓存！<br />3、如果开启了PW缓存库，热榜排行中的缓存内容是从PW缓存库中取得，PW缓存库中的内容未更新时，不能确保热榜排行处的缓存能更新到最新
</div>
<!--
EOT;
if($action=='rebang'){
$column = '<optgroup label="帖子信息"><option value="newpic">图片轮播</option><option value="newpost">最新帖子</option><option value="newreply">最新回复</option><option value="digest">精华帖子</option><option value="hits">人气排行</option><option value="replies">回复排行</option></optgroup><optgroup label="会员信息"><option value="new">最新会员</option><option value="postnum">总发帖排行</option><option value="monthpost">本月发帖排行</option><option value="todaypost">今日发帖排行</option><option value="onlinetime">在线时间排行</option></optgroup><optgroup label="版块信息"><option value="topic">主题排行</option><option value="article">文章排行</option><option value="tpost">今日发帖排行</option></optgroup><optgroup label="积分信息">';
foreach ($credit->cType as $key=>$val){
	$column .= "<option value=\"$key\">{$val}排行</option>";
}
$column .='</optgroup><optgroup label="其他信息"><option value="info">论坛信息</option><option value="custom">自定义栏目</option></optgroup>';
print <<<EOT
-->
<form action="$basename&" method="post">
<input type="hidden" name="action" value="$action">
<input type="hidden" name="job" value="config">
<h2>首页热榜设置</h2>
<table width="100%" cellpadding="0" cellspacing="0">
<tr class="tr3">
	<td width="35%">是否开启首页热榜</td>
	<td>
	<input type=radio value=1 $newinfoifopen_Y name="newinfoifopen"> 是
	<input type=radio value=0 $newinfoifopen_N name="newinfoifopen"> 否
	</td>
</tr>
<tr class="tr3">
	<td width="35%">显示位置</td>
	<td>
	<input type=radio value=1 $position_1 name="position"> 版块上侧
	<input type=radio value=2 $position_2 name="position"> 版块下侧
	<input type=radio value=3 $position_3 name="position"> 版块左侧
	<input type=radio value=4 $position_4 name="position"> 版块右侧
	</td>
</tr>
<tr class="tr3">
	<td>标题截取长度</td>
	<td><input size="35" class="input" value="$nf_config[titlelen]" name="titlelen"></td>
</tr>
<tr class="tr3">
	<td>内容调用条数</td>
	<td><input size="35" class="input" value="$nf_config[shownum]" name="shownum"></td>
</tr>
</table>
<br><center><input type="submit" value="提 交" class="btn"></center>
</form>
<br>

<form action="$basename" method="post" name="cateForm">
<input type="hidden" name="action" value="$action">
<input type="hidden" name="job" value="cate">
<h2><span class="fr" style="margin-right:2em;">[<a style="cursor:pointer;" href="$basename&action=update">更新</a>] [<a style="cursor:pointer;" onclick="return addinput();">添加</a>]</span>栏目管理</h2>
<table width="100%" cellpadding="0" cellspacing="0">

<tr class="tr3 s3">
	<td width="8%">ID</td>
	<td>栏目标题名称</td>
	<td>栏目内容类型</td>
	<td width="15%">显示权值(0关闭)</td>
	<td width="15%">操作</td>
</tr>
<tbody id="cate">
<!--
EOT;
foreach($nf_order as $key=>$val){
$tmpcolumn = str_replace("<option value=\"$val[type]\">","<option value=\"$val[type]\" selected>",$column);
$style = $val[order] ? 'class="b"' : 'style="background:#DDD"';
print <<<EOT
-->
<tr id="ip_$key" class="tr3" $style>
	<td><input type="text" class="input" class="input" name="cate[$key][id]" value="$key" size="5"/><input type="hidden" name="cate[$key][flag]" value="$key"/></td>
	<td><input type="text" class="input" class="input" id="name_$key" name="cate[$key][name]" value="$val[name]"/></td>
	<td><select name="cate[$key][type]" onchange="setname('name_$key',this.options[this.selectedIndex].innerHTML);prompt('prompt_$key');">$tmpcolumn</select></td>
	<td><input type="text" class="input" class="input" name="cate[$key][order]" value="$val[order]" size="10" /></td>
	<td><span id="prompt_$key" style="float:right;display:none"><font color=red>(*)</font></span>
		<a class="fourm-two" onClick="javascript:window.location='$basename&action=setting&type=$val[type]&orderid=$key'" title="设置"><span class="edit" style="margin-right:1em;"></span></a>
		<a class="fourm-two" title="删除" onClick="javascript:if(delinput('ip_$key'))cateForm.submit();"><span class="del" ></span></a>
	</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</tbody>
</table>
<br /><center><input type="submit" class="btn" value="提 交"></center>
</form>
<br />
<script language="JavaScript">
var ip=1000;

function setname(id,text){
	getObj(id).value = text;
}
function prompt(id){
	getObj(id).style.display = 'block';
}
function delinput(id){
	if (confirm("您确定要删除此栏目吗?")) {
		getObj('cate').removeChild(getObj(id));
		return true;
	}
	return false;
}
function addinput(){
	ip++;
	tr = document.createElement('tr');
	tr.id = 'ip_'+ip;
	tr.className = 'tr3';
	td0 = document.createElement('td');
	td1 = document.createElement('td');
	td2 = document.createElement('td');
	td3 = document.createElement('td');
	td4 = document.createElement('td');

	td0.innerHTML ='<input type="text" class="input" class="input" name="cate['+ip+'][id]" value="" size="5"/><input type="hidden" name="cate['+ip+'][flag]" value=""/>';
	td1.innerHTML = '<input type="text" class="input" class="input" name="cate['+ip+'][name]" value="" id="name_'+ip+'"/>';
	td2.innerHTML = '<select name="cate['+ip+'][type]" onchange="setname(\'name_'+ip+'\',this.options[this.selectedIndex].innerHTML);">$column</select>';
	td3.innerHTML = '<input type="text" class="input" class="input" name="cate['+ip+'][order]" value="0" size="10" />';
	td4.innerHTML = '<span id="prompt_'+ip+'" style="float:right;"><font color=red>(*)</font></span>[<a style="cursor:pointer;" onClick="javascript:delinput(\'ip_'+ip+'\')">删除</a>]&nbsp;';
	tr.appendChild(td0);
	tr.appendChild(td1);
	tr.appendChild(td2);
	tr.appendChild(td3);
	tr.appendChild(td4);
	getObj('cate').appendChild(tr);
}
</script>
<!--
EOT;
}elseif($action=='setting'){print <<<EOT
-->
<form action="$basename" method="post">
<input type="hidden" name="action" value="$action">
<input type="hidden" name="type" value="$type">
<input type="hidden" name="step" value="2">
<input type="hidden" name="orderid" value="$orderid">
<h2>{$nf_order[$orderid][name]}</h2>
<table width="100%" cellpadding="0" cellspacing="0">
<tr class="tr3">
	<td align="right">更新缓存时间(默认时间=0,单位:秒)</td>
	<td colspan="2"><input type="text" class="input" name="updatetime" value="{$nf_order[$orderid][updatetime]}" /></td>
</tr>
<!--
EOT;
if($type=='newpic'){print <<<EOT
-->
<tr class="tr3">
	<td width="33%">图片选取方式</td>
	<td colspan="2">
		<input type=radio value=0 name="picmode" onclick="seltype('0')" $picmode_1 /> 最新图片
		<input type=radio value=1 name="picmode" onclick="seltype('1')" $picmode_2 /> 自定义图片
	</td>
</tr>
<tbody id="custom" style="display:none">
<tr><td class="tr4" colspan="3"><b>自定义图片</b></td></tr>
<tr class="tr3 tac">
	<td width="33%">图片地址</td>
	<td>图片标题</td>
	<td>外部链接</td>
</tr>
<!--
EOT;
for($i=0;$i<$nf_config[shownum];$i++){
if($nf_newinfodb[$orderid][$i]){print <<<EOT
-->
	<tr class="tr3 tac">
		<td><input type="text" class="input" name="urls[]" value="{$nf_newinfodb[$orderid][$i][value]}" size="50" /></td>
		<td><input type="text" class="input" name="title[]" value="{$nf_newinfodb[$orderid][$i][name]}" size="50" /></td>
		<td>
<!--
EOT;
if (is_numeric($nf_newinfodb[$orderid][$i][id])) {
print <<<EOT
-->
		<input type="text" class="input" name="links[]" value="" size="50" />
<!--
EOT;
}else{print <<<EOT
-->
		<input type="text" class="input" name="links[]" value="{$nf_newinfodb[$orderid][$i][id]}" size="50" />
<!--
EOT;
}print <<<EOT
-->
		<input type="hidden" value="{$nf_newinfodb[$orderid][$i][id]}" name="idlinks[]" /></td>
	</tr>

<!--
EOT;
}else{print <<<EOT
-->
	<tr class="tr3 tac">
		<td><input type="text" class="input" name="urls[]" size="50" /></td>
		<td><input type="text" class="input" name="title[]" size="50" /></td>
		<td><input type="text" class="input" name="links[]" size="50"/></td>
	</tr>
<!--
EOT;
}}print <<<EOT
-->
</tbody>
<script language="JavaScript">
function seltype(show){
	document.getElementById('custom').style.display = show == '1' ? '' : 'none';
}
seltype('{$nf_order[$orderid][mode]}');
</script>
<!--
EOT;
}elseif($type=='custom'){
print <<<EOT
-->
<tr class="tac">
	<td class="tr4" width="50%">标题</td>
	<td class="tr4" >链接地址</td>
</tr>
<!--
EOT;
for($i=0;$i<$nf_config[shownum];$i++){
if($nf_newinfodb[$orderid][$i]){
print <<<EOT
-->
	<tr class="tr3 tac">
		<td><input type="text" class="input" name="titles[]" value="{$nf_newinfodb[$orderid][$i][name]}" size="70" /></td>
		<td><input type="text" class="input" name="links[]" value="{$nf_newinfodb[$orderid][$i][id]}" size="70" /></td>
	</tr>
<!--
EOT;
}else{print <<<EOT
-->
	<tr class="tr3 tac">
		<td><input type="text" class="input" name="titles[]" size="70" /></td>
		<td><input type="text" class="input" name="links[]" size="70" /></td>
	</tr>
<!--
EOT;
}}}elseif($type=='info'){
print <<<EOT
-->
<tr class="tr3">
	<td width="35%" class="tar">首页热榜显示项目</td>
	<td>
		<input type="checkbox" value="newmember" name="info[]" $newmember> 最新注册会员<br />
		<input type="checkbox" value="totalmember" name="info[]" $totalmember> 论坛会员总数<br />
		<input type="checkbox" value="topic" name="info[]" $topic> 论坛主题总数<br />
		<input type="checkbox" value="article" name="info[]" $article> 论坛帖子总数<br />
		<input type="checkbox" value="tposts" name="info[]" $tposts> 今日发帖数<br />
		<input type="checkbox" value="yposts" name="info[]" $yposts> 昨日发帖数<br />
		<input type="checkbox" value="hposts" name="info[]" $hposts> 最高日发帖数<br />
		<input type="checkbox" value="users" name="info[]" $users> 当前在线会员数<br />
		<input type="checkbox" value="guest" name="info[]" $guest> 当前在线游客数<br />
		<input type="checkbox" value="usertotal" name="info[]" $usertotal> 当前在线总数<br />
		<input type="checkbox" value="higholnum" name="info[]" $higholnum> 最高在线人数<br />
		<input type="checkbox" value="higholtime" name="info[]" $higholtime> 最高在线发生时间<br />
	</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<br /><center><input type="submit" class="btn" value="提 交"></center>
</form>
<br />
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->